home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
9-Digit Zip Code Directory
/
9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO
/
z4src.zip
/
ZICANCEL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-09
|
5KB
|
186 lines
//----------------------------------------------------------------------------
// MODULE DESCRIPTION
//
// Module: zn.cpp
// Title: Zinc Window Template
// Notice: John M. Weeder
// Copyright (c) 1993. All rights reserved.
// This module contains proprietary information and should be
// treated as confidential.
//
//----------------------------------------------------------------------------
// MAINTENANCE HISTORY
//
// $Workfile$
// $Revision$
// $Author$
// $Date$
// $Log$
//
//----------------------------------------------------------------------------
// MODULE NARRATIVE
//
// This module contains code for the class ZI_CANCEL.
//
// The code in this module may be written in C++ or C.
//
// This module is portable to:
// DOS 3.X+
// MS Windows 3.X+
// OS/2 2.X+
// OS/2 2.0 PM
//
// The following compilers are supported:
// MSC 6.0A
// MSC/C++ 7.0
// Borland C++ 3.1 for DOS
// Borland C++ 1.0 for OS/2 2.X
//
//----------------------------------------------------------------------------
#include <zi.hpp>
#define USE_WIN_CANCEL
#if OS_DOS
#include <zid.hpp>
#elif OS_WINDOWS
#include <ziw.hpp>
#else
#include <zio.hpp>
#endif
//----------------------------------------------------------------------------
// Description: Default constructor
// Parameters:
// Returns:
//----------------------------------------------------------------------------
FN_M ZI_CANCEL::ZI_CANCEL()
: ZN_WINDOW("WIN_CANCEL", ZN_LOAD_CENTER)
{
ZI_CANCEL::Initialize(CL_INIT_CLASS);
Setup();
}
//----------------------------------------------------------------------------
// Description: Destructor
// Parameters:
// Returns:
//----------------------------------------------------------------------------
FN_M ZI_CANCEL::~ZI_CANCEL()
{
ZI_CANCEL::Destroy(FALSE);
Terminate();
}
//----------------------------------------------------------------------------
// Description: Destroy object. Free any resources used by object.
// Normally called by destructor.
// Should allow multiple calls from various classes.
// A class should almost always re-init its variables when
// it is destroyed to prevent accidents.
// Parameters: fDestroyAll Destroy parents also?
// Default is TRUE.
// Returns: TRUE if successful.
//----------------------------------------------------------------------------
BOOL FN_M ZI_CANCEL::Destroy(BOOL fDestroyAll)
{
// Destroy object specific stuff
ZI_CANCEL::Initialize(CL_INIT_CLASS_VARS);
if (fDestroyAll) // Destroy parent.
ZI_CANCEL_PARENT::Destroy(fDestroyAll);
return TRUE;
}
//----------------------------------------------------------------------------
// Description: Initialize object.
// Normally called by constructor.
// Should allow multiple calls from various classes.
// Parameters: sInit Initialization code. May be one of the following:
// CL_INIT_CLASS Reset class variables and
// and dynamic allocations for
// this class only.
// CL_INIT_CLASS_VARS Reset class variables for
// this class only.
// CL_INIT_VARS Reset class variables for
// this class only.
// CL_INIT_ALL Initialize class and all
// parent class, including
// dynamic memory allocation.
// Default is CL_INIT_ALL
// Returns: TRUE if successful.
//----------------------------------------------------------------------------
BOOL FN_M ZI_CANCEL::Initialize(SHORT sInit)
{
if (sInit == CL_INIT_VARS || sInit == CL_INIT_ALL)
ZI_CANCEL_PARENT::Initialize(sInit);
sBitmap = 0;
return TRUE;
}
//----------------------------------------------------------------------------
// Description:
// Parameters:
// Returns: Event code
//----------------------------------------------------------------------------
VOID FN_M ZI_CANCEL::NextBitmap(SHORT sNext)
{
static PCSZ apcsz[] =
{
"USA0",
"USA1",
"USA2",
"USA3",
"USA4",
"USA5",
"USA6",
"USA7",
NULL
};
if (sNext >= 0)
sBitmap = MIN(sNext, (sizeof(apcsz)/sizeof(PCSZ)) - 2);
LoadButtonBitmap(FID(BUTTON_CANCEL), apcsz[sBitmap]);
sBitmap++;
if (apcsz[sBitmap] == NULL)
sBitmap = 0;
return ;
}
//----------------------------------------------------------------------------
// Description: Event monitor function.
// Parameters: msg Event code
// pv1 Data pointer 1
// pv2 Data pointer 2
// Returns: Event code
//----------------------------------------------------------------------------
ZN_MSG FN_M ZI_CANCEL::User(ZN_MSG msg, PVOID, PVOID)
{
switch (msg)
{
case ZN_MSG_INIT:
return msg;
case ZN_MSG_TERMINATE:
return msg;
}
if (IsError()) // Error condition
return msg;
switch (msg)
{
case BUTTON_CANCEL:
SendMessage(ZiMainWindow(), ZI_MSG_ABORT, NULL, NULL);
break;
}
return msg;
}
//----------------------------------------------------------------------------
//------------------------------- End of File --------------------------------
//----------------------------------------------------------------------------